<template>
  <ContentLayout>
    <EvBuilder ref="builder" :layoutModelCode="layoutModelCode" @ready="ready"></EvBuilder>
    <Ev-Button type="primary" @click="getValues">获取</Ev-Button>
  </ContentLayout>
</template>
  <script>
import EvBuilder from "@/components/EvBuilder";
export default {
  name: "Builder",
  components: {
    EvBuilder,
  },
  data() {
    return {
      layoutModelCode: "taskBaseViewModel",
      // 生成规则
      rule: [],
      form: {
        title: "任务基本信息",
        code: "taskBaseViewModel",
        planBegin: new Date(),
        level: "1",
        responsibleId: "170070673600002",
      },
    };
  },
  methods: {
    ready(rule) {
      console.log(rule);
      this.rule = rule;
      this.setValues();
    },
    getValues() {
      // console.log(this.$refs.builder);
      // console.log(this.$refs.builder.getFomilyData());
      console.log(this.$refs.builder.getValues());
    },
    setValues() {
      this.$refs.builder.setValues("custome_form", this.form);
    },
  },
};
</script>